import request from '@/router/axios';

/* 商户信息 详情 */
/* export const getInfoDetail = (id) => {
  return request({
    url: '/api/rb-merchant/merchant/posinfo/pos_info/detailOne',
    method: 'get',
    params: {
      id
    }
  })
} */

/* 商户信息 详情 */
export const getInfoDetail = (rpiNo) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/basicDetail',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 商户资质证件图片 详情 */
/* export const getPicDetail = (incomingCode) => {
  return request({
    url: '/api/rb-merchant/merchant/posinfo/pos_info/picDetail',
    method: 'get',
    params: {
      incomingCode
    }
  })
} */

export const getPicDetail = (rpiNo) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/basicPicDetail',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 商户资质证件图片修改 详情 */
export const getPicUpdateDetail = (incomingCode) => {
  return request({
    url: '/api/rb-merchant/merchant/posinfo/pos_info/picUpdateDetail',
    method: 'get',
    params: {
      incomingCode
    }
  })
}

/* 基本信息修改 */
export const basicInformationUpdate = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/posinfo/pos_info/basicInformationUpdate',
    method: 'post',
    data: row
  })
}

/* 图片信息修改 */
export const updateAllPic = (row) => {
  return request({
    // url: '/api/rb-merchant/merchant/posinfo/pos_info/updateAllPic',
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/updatePicAll',
    method: 'post',
    data: row
  })
}

/* 微信认证通道列表 */
export const queryAisleList = (rpiNo) => {
  return request({
    url: '/api/rb-merchant/merchant/posinfo/pos_info/queryAisleList',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 通道列表 v2.0.0 */
export const queryBasicAisleList = (rpiNo) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/queryBasicAisleList',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 通道列表 v2.0.0 plus */
export const queryBasicAisleListPlus = (rpiNo) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/queryBasicAisleListPlus',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 实名认证 rpiNo aisleCode custType(1微信 2支付宝) */
export const queryReal = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/queryReal',
    method: 'post',
    data: row
  })
}

/* 微信认证通道详情 */
export const yinshengDetail = (rpiNo) => {
  return request({
    url: '/api/rb-merchant/merchant/posinfo/pos_info/yinshengDetail',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 撤销申请 wechat */
export const getRevoke = (applyNo) => {
  return request({
    url: '/api/rb-merchant/merchant/posinfo/pos_info/cancelApplyWxAuthor',
    method: 'post',
    params: {
      applyNo
    }
  })
}

/* 撤销申请 alipay */
export const getCancelAuthMessages = (applyNo) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/cancelAuthMessages',
    method: 'post',
    params: {
      applyNo
    }
  })
}

/* 开通或关闭d0 */
export const postOptOnlineDO = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/posinfo/pos_info/optOnlineD0',
    method: 'post',
    data: row
  })
}

/* 重新发短信 */
export const resendMsg = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/posinfo/pos_info/resendMsg',
    method: 'post',
    data: row
  })
}

/* 查询微信实名认证数据 */
export const queryWXApplyData = (rpiNo) => {
  return request({
    url: '/api/rb-merchant/merchant/posinfo/pos_info/queryWXApplyData',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 修改微信签约信息 */
export const updateWXApplyData = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/posinfo/pos_info/updateWXApplyData',
    method: 'post',
    data: row
  })
}

/* 定位ip权限修改 */
export const ipLimitChange = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/ipLimitChange',
    method: 'post',
    data: row
  })
}

/* 商户签约费率*/
export const queryAisleRate = (aisleCode, rpiNo) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/queryAisleRate',
    method: 'get',
    params: {
      aisleCode,
      rpiNo
    }
  })
}

/* 变更服务商 详情 */
export const getServiceChangeDetail = (rpiNo) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/serviceChangeDetail',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 变更服务商 提交 */
export const serviceChange = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/serviceChange',
    method: 'post',
    data: row
  })
}

/* 变更集团商户 提交 */
export const groupChange = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/groupChange',
    method: 'post',
    data: row
  })
}

/* 通道配置 详情 */
export const getQueryAisleDetailByRpi = (rpiNo) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/queryAisleDetailByRpi',
    method: 'get',
    params: {
      rpiNo
    }
  })
}

/* 通道支付公司配置 详情 */
export const queryCompDetailByRpi = (params) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/queryCompDetailByRpi',
    method: 'get',
    params: {
      ...params
    }
  })
}

/* 通道配置 状态控制 0否1是 rpiNo, aisleCode, payKind, isOn */
export const onOrOffPayCompany = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/onOrOffPayCompany',
    method: 'post',
    data: row
  })
}

/* 通道支付公司配置 状态控制 0否1是 rpiNo, aisleCode, compNo, skillType, isOn */
export const onOrOffPayCompanySkill = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/onOrOffPayCompanySkill',
    method: 'post',
    data: row
  })
}

/* 通道配置 变更默认通道 */
export const changeDefaultAisle = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/changeDefaultAisle',
    method: 'post',
    data: row
  })
}

/* 通道配置 变更过支付能力默认通道 */
export const changeDefaultSkillAisle = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/changeDefaultSkillAisle',
    method: 'post',
    data: row
  })
}

/* 图片信息修改 v2.0.0 */
export const updatePicAll = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/incomingbasic/incoming_basic/updatePicAll',
    method: 'post',
    data: row
  })
}